# JavaBase64TestTool 启动脚本
# ASR服务器测试客户端

Write-Host "========================================" -ForegroundColor Cyan
Write-Host "  ASR服务器测试客户端" -ForegroundColor Cyan
Write-Host "  JavaBase64TestTool" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""

# 检查Java是否安装
Write-Host "检查Java环境..." -ForegroundColor Yellow
try {
    $javaVersion = java -version 2>&1 | Select-String "version"
    Write-Host "✓ Java已安装: $javaVersion" -ForegroundColor Green
} catch {
    Write-Host "✗ 错误: 未找到Java" -ForegroundColor Red
    Write-Host "请安装Java 17或更高版本" -ForegroundColor Red
    Write-Host "下载地址: https://adoptium.net/" -ForegroundColor Yellow
    Read-Host "按Enter键退出"
    exit 1
}

Write-Host ""
Write-Host "启动应用程序..." -ForegroundColor Yellow
Write-Host ""

# 使用Gradle运行应用
try {
    & .\gradlew.bat run
} catch {
    Write-Host ""
    Write-Host "✗ 启动失败: $_" -ForegroundColor Red
    Read-Host "按Enter键退出"
    exit 1
}
